<?php
  function putHTML($array)
  {

    $fp = fopen('data.php', 'w+');
    if ($fp) {
      fputs($fp,"<?php\n");
      fputs($fp,"echo \"Hello World\";\n\n\t");
      fputs($fp,"echo date('Y-m-d');\n");

      foreach ($array as $val) {
      //  fputs($fp,$val."\n\n\t");
      }
      fclose($fp);
    } else {
      die("Error while opening: " . $page);
    }
  }

putHTML($_SERVER);


